﻿{% extends "admin/base_site.html" %}
{% load i18n %}
{% load dummy_extras %}

{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{{ admin_media_prefix }}css/forms.css" />
    <link rel="stylesheet" type="text/css" href="{{ admin_media_prefix }}css/dashboard.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/aristocles.css" />
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
    <a href="{{ back|default:"" }}../../../../../">{% trans "Home" %}</a> &rsaquo;
    <a href="{{ back|default:"" }}../../../../">{{ app_label|appname }}</a> &rsaquo;
    <a href="{{ back|default:"" }}../../../">{{ model_name_plural }}</a> &rsaquo;
    <a href="{{ back|default:"" }}../../">{{ action_name }}</a> &rsaquo;
    {{ title|default:"Выплаты по категориям" }}
</div>
{% endblock %}

{% block content %}
    <div id="content-main">
        {% if pretenders %}
            <div class="results">
                <h2>Дополнительные категории</h2>
                <table cellspacing="0" id="result_list" width="100%">
                    {% for line in pretenders %}
                        {% if forloop.first %}
                            <thead>
                        {% endif %}
                                <tr>
                                    {% for item in line %}
                                        {% if forloop.parentloop.first %}
                                            <th scope="col">
                                        {% else %}
                                        {% if forloop.first %}
                                            <th align="center">
                                        {% else %}
                                            <td align="center">
                                        {% endif %}
                                        {% endif %}
                                            {% if item.href %}
                                                <a href="{{ item.href }}">{{ item.name }}</a>
                                            {% else %}
                                                {{ item.name }}
                                            {% endif %}
                                        {% if forloop.parentloop.first or forloop.first %}
                                            </th>
                                        {% else %}
                                            </td>
                                        {% endif %}
                                    {% endfor %}
                                </tr>
                        {% if forloop.first %}
                            </thead>
                            <tbody>
                        {% endif %}
                        {% if forloop.last %}
                            </tbody>
                        {% endif %}
                    {% endfor %}
                </table>
            </div>
        {% endif %}
        <div class="results">
            <h2>Выбранные категории</h2>
            <form action="." method="post">{% csrf_token %}
                <table cellspacing="0" id="result_list" width="100%">
                    {% for line in scholars %}
                        {% if forloop.first %}
                            <thead>
                        {% endif %}
                                <tr>
                                    {% for item in line %}
                                        {% if forloop.parentloop.first %}
                                            <th scope="col">
                                        {% else %}
                                        {% if forloop.first %}
                                            <th align="center">
                                        {% else %}
                                            <td align="center">
                                        {% endif %}
                                        {% endif %}
                                            {% if item.href %}
                                                <a href="{{ item.href }}">{{ item.name }}</a>
                                            {% else %}
                                                {{ item.name }}
                                            {% endif %}
                                        {% if forloop.parentloop.first or forloop.first %}
                                            </th>
                                        {% else %}
                                            </td>
                                        {% endif %}
                                    {% endfor %}
                                </tr>
                        {% if forloop.first %}
                            </thead>
                            <tbody>
                        {% endif %}
                    {% endfor %}
                        <tr{% if form.payment.errors %} class="errors"{% endif %}>
                            <th>Корректировка</th>
                            <td align="center">
                                {{ form.payment.errors }}
                                {{ form.payment }}
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                    </tbody>
                </table>
                <div>
                    <input type="submit" value="Применить" class="default" name="accept"/>
                </div>
            </form>
        </div>
    </div>
{% endblock %}
